package com.blog.effective.note8;

import java.util.ArrayList;
import java.util.List;

/**
 * 〈覆equals方法的时候应该注意的问题〉<br>
 *
 * @author 未绪
 * @time 2017/12/17 8:32
 */
public class MyEqualsDemo1 {


    public static void main(String[] args) {

        WindowsFileName windowsFileName=new WindowsFileName("F:\\test");
        String fileName="F:\\TEST";

        System.out.println(windowsFileName.equals(fileName));   //true
        System.out.println(fileName.equals(windowsFileName));   //false

        List<Object> list=new ArrayList<>();
        list.add(fileName);
        System.out.println(list.contains(windowsFileName));

    }
}
